﻿using System;

namespace ExFlash.Actions
{
    public class ActionGoToFrame2 : ActionRecord
    {
        public Boolean SceneBiasFlag
        {
            get;
            protected set;
        }

        public Boolean PlayFlag
        {
            get;
            protected set;
        }

        public ushort SceneBias
        {
            get;
            protected set;
        }

        public ActionGoToFrame2(ushort len)
            : base((byte)ActionCodes.ActionGoToFrame2, len)
        {
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            reader.SkipBits(6);
            SceneBiasFlag = reader.ReadBoolean();
            PlayFlag = reader.ReadBoolean();

            reader.AlignBits();

            if (SceneBiasFlag)
            {
                SceneBias = reader.ReadUInt16();
            }
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
